<?php

use yii\helpers\Html;
use app\common\Functions;

/* @var $this  yii\web\View */
/* @var $model \yii2mod\rbac\models\BizRuleModel */
/* 客户资料的详细信息*/

$this->title = Yii::t('region', 'Create RegionType');
//$this->params['breadcrumbs'][] = ['label' => Yii::t('yii2mod.rbac', 'Rules'), 'url' => ['index']];
//$this->params['breadcrumbs'][] = $this->title;
//$this->render('/layouts/_sidebar');

$custAttrTotal = count($model->custExternalAttrs)/2+count($model->custExternalAttrs)%2;
$index = 0;
?>

<style>
    .cust-info-group  .list-group-item {  display: flow-root; }

    .cust-info-group  .list-group-item-big {content:'';  display: table;  clear: both }
</style>

<section class="content">
    <div class="row cust-info-group">
        <div class="col-md-12">
            <h3 class="profile-username text-center"><?= Html::encode( $model->cust_name ) ?></h3>
            <p class="text-muted text-center"><?= Html::encode( $orderModel->parentRegions->region_name . ' ' . $orderModel->regions->region_name ) ?></p>
        </div>
        <div class="col-md-12">
            <div class="col-md-4">
                <ul class="list-group list-group-unbordered">

                    <?php foreach ($topShows as $topShow): ?>
                        <?php if($topShow['field_name']=='客户描述'): ?>

                            <li class="list-group-item list-group-item-big">

                        <?php else: ?>
                            <li class="list-group-item">
                        <?php endif; ?>

                            <b><?= Html::encode( $topShow['field_name'] ) ?></b> <a class="pull-right"><?= Html::encode( $topShow['field_values'] ) ?></a>
                        </li>
                    <?php endforeach; ?>
                </ul>
            </div>

            <div class="col-md-4">
                 <ul class="list-group list-group-unbordered">
                        <?php foreach ($model->custExternalAttrs as $attrInst): ?>
                            <li class="list-group-item">
                                <b><?= Html::encode( $attrSpecNames[$attrInst->attr_spec_id]['name'] ) ?></b> <a class="pull-right">

                                    <?php if($attrSpecNames[$attrInst->attr_spec_id]['attr_spec_type_id'] ==3): ?>
                                        <?= Html::encode(   Functions::getDomainsName('attr_spec',$attrInst->attr_spec_id, $attrInst->content )  ) ?>
                                    <?php else: ?>
                                        <?php if($attrInst->attr_spec_id==3): ?>
                                            <?= Html::encode( $model->tel) ?>
                                         <?php else: ?>
                                            <?= Html::encode( $attrInst->content) ?>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </a>
                            </li>

                        <?php endforeach; ?>
                 </ul>
            </div>

            <div class="col-md-4">
                <ul class="list-group list-group-unbordered">
                    <?php foreach ($orderModel->externalAttrs as $attrInst): ?>
                        <li class="list-group-item">
                            <b><?= Html::encode( $attrOrderSpecNames[$attrInst->attr_spec_id]['name'] ) ?></b> <a class="pull-right">

                                <?php if($attrOrderSpecNames[$attrInst->attr_spec_id]['attr_spec_type_id'] ==3): ?>
                                    <?= Html::encode(   Functions::getDomainsName('attr_spec',$attrInst->attr_spec_id, $attrInst->content )  ) ?>

                                    <?php elseif($attrOrderSpecNames[$attrInst->attr_spec_id]['attr_spec_type_id'] ==4 ): ?>
                                    <?= Html::encode( $attrInst->content  ) ?> - <?= Html::encode( $attrInst->content2  ) ?>
                                <?php else: ?>
                                    <?= Html::encode( $attrInst->content  ) ?>
                                <?php endif; ?>

                            </a>
                        </li>

                    <?php endforeach; ?>
                </ul>
            </div>



        </div>
    </div>
</section>
